package com.sihan.framework.etm.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Id;

import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
public class Log implements Serializable {

	private static final long serialVersionUID = 1L;

	/**
	 * 日志ID
	 */
	@Id
	private Long id;

	/**
	 * 访问IP
	 */
	private String ip;

	/**
	 * 方法名
	 */
	private String methodName;

	/**
	 * 操作
	 */
	private String operation;
	/**
	 * 描述
	 */
	private String content;
	/**
	 * 状态：0失败、1成功
	 */
	private Boolean state;
	/**
	 * 日志类型
	 */
	private Integer logType;
	/**
	 * 异常事件等级
	 */
	private String exceLevel;

	/**
	 * 耗时
	 */
	private Integer costTime;

	/**
	 * 创建用户
	 */
	private String createUser;

	/**
	 * 创建时间
	 */
	private Date createTime;

	/**
	 * 是否删除
	 */
	@JsonIgnore
	private Boolean isDelete;

	public Log(Integer logType) {
		this.logType = logType;
	}

	public Log(String ip, String operation, String content, Boolean state, Integer logType, String exceLevel,
			String createUser, Date createTime) {
		this.ip = ip;
		this.operation = operation;
		this.content = content;
		this.state = state;
		this.logType = logType;
		this.exceLevel = exceLevel;
		this.createUser = createUser;
		this.createTime = createTime;
	}
}
